//统一管理咱们项目用户相关的接口
import request from '@/util/request.ts'

//项目用户相关的请求地址
enum API {
  ADD_SESSION_URL = '/user/message/create',
  USER_SESSION_LIST_URL = '/user/message/userList',
  SESSION_MESSAGE_LIST_URL = '/user/message/list',
  ADD_MESSAGE_URL = '/user/message/add',
}

// 创建会话
export const reqAddSession = (data) =>
  request.post(API.ADD_SESSION_URL + `/${data}`)


// 获取当前用户会话列表
export const reqUserSessionList = () =>
    request.get(API.USER_SESSION_LIST_URL)

// 获取会话下信息列表
export const reqSessionMessageList = (sessionId) =>
    request.get(API.SESSION_MESSAGE_LIST_URL+`/${sessionId}`)


// 获取会话下信息列表
export const reqAddMessage = (data) =>
    request.post(API.ADD_MESSAGE_URL , data)
